<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<head>
 	<meta http-equiv="Cache-Control" content="no-cache"/>
	<title> Web rezervacije</title>
	<script type="text/javascript" src="js/submitButton.js"></script>
	<script type="text/javascript" src="js/checkTextField.js"></script>
	<script type="text/javascript" src="js/validateNumber.js"></script>
</head>

<f:view>
	<h1>Prijavljen korisnik: <h:outputText value="#{users.user.username}" /> </h1>
	<h3>Rezervacija sedista</h3>
	
	<ui:param name="flight" value="#{flights.flight}" />
	
	<h3>Let <h:outputText value="#{flight.idLeta}" />
	, od <h:outputText value="#{flight.polaziAerodrom}" />
	, do <h:outputText value="#{flight.odrediste}" />
	, vreme polaska: <h:outputText value="#{flight.vremePolaskaString}" />
	, vreme dolaska: <h:outputText value="#{flight.vremeDolaskaString}" /></h3>
	
	<div style="visibility: hidden;" id="praznaPolja">
	<p><font color="red">Morate popuniti sva polja</font></p></div>
	
	<form method="post" action="ReservationServlet" onsubmit="return submitButton();">
  		<table border="0" width="60%">
  		<tr><td><div id="JMBGP">JMBG putnika:</div></td><td><input id="JMBG" type="text" name="JMBG" onblur="checkTextField(this);" onkeypress="validateNumber(event)"/></td>   </tr>
  		<tr><td><div id="imeP">Ime:</div></td><td><input id="ime" type="text" name="ime" onblur="checkTextField(this);"/></td>  </tr>
  		<tr><td><div id="prezimeP">Prezime:</div></td><td><input id="prezime" type="text" name="prezime" onblur="checkTextField(this);"/></td>  </tr>
  		<h:inputHidden id="idLeta" value="#{flight.idLeta}" />
  		<tr><td> &nbsp; </td><td><input type="submit" name="submit" value="Rezervisi"/></td></tr>
  		</table>
  	</form>
  	
  	<p><a href="listFlightServlet?listFlight=flights">Spisak svih letova</a></p>

</f:view>

</html>	